﻿@{
    Layout = null;
}
@using RollCall.Model;
@using RollCall.UI.Models;

<!DOCTYPE html>

<html>
<head>
    <link href="~/Vendor/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
    <meta name="viewport" content="width=device-width" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="~/Scripts/jquery-2.1.3.min.js"></script>
    <title>CallNameReason</title>
    <script>

    $(function () {
        $("td input[type='button']").each(function () {
            var state = $(this).attr("ustate")
            var uname = $(this).attr("uname")
            $(this).parent().siblings().children("select").val(state); //父 同 子
        });

        $("#submit").click(
                function () {
                    var ustate = "";
                    $("td select").each(function () {
                        ustate+=$(this).attr("unameid")+" "+this.value+",";
                    });
                    //alert(ustate)
                    $.post("/Phone/ZTBDSubmit/reason2", { aa: ustate }, function () {    
                        alert("數據提交成功 OK")
                        window.location.href = "/Phone/Index";
                    })
                })



    })
    </script>
</head>
<body>

    <form id="form1">
        <div class="row ">
            <label ID="Label1" class="col-xs-12" Font-Size="X-Large" style="text-align:center">
                員工中途離開的原因
                </label>

        </div>

        <div class="container-fluid">
            <div class="row">
                <Table ID="HolderTable" class="table table-condensed table-striped  textcenter">
                    @*<tr><td><input  type="button" value="名字" class="btn btn-info btn-lg btn-block" /></td></tr>*@
                    @foreach (CallName s in (List<CallName>)ViewData["CallName_Models"])
                    {
                        <tr>
                            @*<td><input type="button" value="@s.NAME" uname="@s.NAME" name="@s.ID" statenaem="@s.STATE" class="btn btn-info btn-lg " /></td>*@
                            <td><input type="button" value="@s.NAME " ustate="@s.STATE" class="btn btn-info btn-lg col-xs-12" /></td>
                            <td>
                                <select class="form-control border-radius" unameid="@s.ID">
                                    <option>請假</option>
                                    <option>早退</option>
                                    <option>曠工</option>

                                </select>
                            </td>
                        </tr>
                    }
                </Table>
            </div>

            <div class="row ">

                <input id="submit" type="button" value="提交并返回" class="btn btn-success btn-lg btn-block" /><br /><br />
            </div>

        </div>
        <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    </form>

</body>
</html>
